//created by: Justina Lee

Ext.define("MajorProjectSenchaTouch.view.MoreMenuDV", {
    extend: 'Ext.DataView',
    xtype: 'moremenuDV',
    requires:[
    'MajorProjectSenchaTouch.store.Modules'
    ],
    config: {
        cls: 'moreMenu',
        pressedCls:'pressed',
        store: 'Modules',
        itemTpl: new Ext.XTemplate(
            '<div class="{[this.itemClass(values.xindex)]}">{title}</div>',
            {
                compiled:true,
                itemClass: function(position){
                    var store = Ext.getStore('Modules');
                    var totalCount = store.getCount();

                    var retClass;
                    if(position == 1){
                        retClass = 'moreMenuItemFirst';
                    }else if(position == totalCount){
                        retClass = 'moreMenuItemLast';
                    }else{
                        retClass = 'moreMenuItem';
                    }
                    return retClass;
                }
            }
            )
    }
});
